import {
  SETKEY,
  CONNECTEOSNET,
  SETACCOUNTDATA,
  SETEOSNETCONFIG,
  SETLANG,
  SETBALANCE,
  SETISMOBILE,
  SETDIFTIME
} from './type'

export default {
  [SETKEY] (state, key) {
    state.key = key
    state.isOnline = true
  },
  [CONNECTEOSNET] (state, eos) {
    state.eos = eos
  },
  [SETACCOUNTDATA] (state, accountData) {
    console.log('mutations')
    state.accountData = accountData
  },
  [SETEOSNETCONFIG] (state, config) {
    state.isOnline = false
    state.eos = null
    state.isOnline = false
    state.key = null
    state.accountData = null
    state.eosConfig = config
  },
  [SETLANG] (state, lang) {
    state.lang = lang
  },
  [SETBALANCE] (state, data) {
    state.balance = data
  },
  [SETISMOBILE] (state, val) {
    state.isMobile = val
  },
  [SETDIFTIME] (state, val) {
    state.timediffer = val
  }
}
